package com.wink.admin.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;


/**
 * 系统日志表
 *
 * @author wink
 * @date 2020/11/20 15:40:50
 */
@Data
@Entity
@Table(name = "sys_log")
@TableName("sys_log")
@EqualsAndHashCode(callSuper = true)
@org.hibernate.annotations.Table(appliesTo = "sys_log", comment = "系统日志表")
public class SysLog extends BaseEntity {

    /**
     * 日志类型
     */
    @Column(name = "type", columnDefinition = ("varchar(30) not null comment '日志类型'"))
    private String type;

    /**
     * 日志标题
     */
    @Column(name = "title", columnDefinition = ("varchar(100) default null comment '日志标题'"))
    private String title;

    /**
     * 创建者
     */
    @Column(name = "create_by", columnDefinition = ("varchar(100) default null comment '创建者'"))
    private String createBy;

    /**
     * 用户浏览器
     */
    @Column(name = "user_agent", columnDefinition = ("varchar(100) not null comment '用户浏览器'"))
    private String userAgent;

    /**
     * IP
     */
    @Column(name = "remote_addr", columnDefinition = ("varchar(100) not null comment 'IP'"))
    private String remoteAddr;

    /**
     * 请求URI
     */
    @Column(name = "request_uri", columnDefinition = ("varchar(500) not null comment '请求URI'"))
    private String requestUri;

    /**
     * 操作方式
     */
    @Column(name = "method", columnDefinition = ("varchar(500) not null comment '操作方式'"))
    private String method;

    /**
     * 操作提交的数据
     */
    @Column(name = "params", columnDefinition = ("varchar(2048) not null comment '操作提交的数据'"))
    private String params;

    /**
     * 执行时间
     */
    @Column(name = "time", columnDefinition = ("bigint(20) not null comment '执行时间(ms)'"))
    private Long time;

    /**
     * 异常信息
     */
    @Column(name = "exception", columnDefinition = ("varchar(2048) default null comment '异常信息'"))
    private String exception;

    /**
     * 服务ID
     */
    @Column(name = "service_id", columnDefinition = ("varchar(100) default null comment '服务ID'"))
    private String serviceId;
}
